package com.xoa.dev.pz.controller;

import com.xoa.dev.pz.model.PzDailyPeace;
import com.xoa.dev.pz.service.PzDailyPeaceService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * description 信访稳定-每日平安稳定信息接口
 * Created by 刘新婷 on 2017/12/7.
 */
@Controller
@RequestMapping("/pzPeace")
public class PzDailyPeaceController {

    @Resource
    private PzDailyPeaceService pzDailyPeaceService;

    /**
     * @description: : 添加每日平安稳定信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param request
     * @param pzDailyPeace
     * @return
     */
    @RequestMapping("/insertSelective")
    @ResponseBody
    public ToJson<PzDailyPeace> insertSelective(HttpServletRequest request, PzDailyPeace pzDailyPeace){
        return pzDailyPeaceService.insertSelective(request,pzDailyPeace);
    }

    /**
     * @description: : 修改每日平安稳定信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param pzDailyPeace
     * @return
     */
    @RequestMapping("/updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<PzDailyPeace> updateByPrimaryKeySelective (PzDailyPeace pzDailyPeace){
        return pzDailyPeaceService.updateByPrimaryKeySelective(pzDailyPeace);
    }

    /**
     * @description: : 删除每日平安稳定信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param dailyId
     * @return
     */
    @RequestMapping("/deleteByPrimaryKey")
    @ResponseBody
    public ToJson<PzDailyPeace> deleteByPrimaryKey(Integer dailyId){
        return pzDailyPeaceService.deleteByPrimaryKey(dailyId);
    }

    /**
     * @description: : 查询每日平安稳定列表信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param output
     * @param pzDailyPeace
     * @param page
     * @param pageSize
     * @param useFlag
     * @param request
     * @param response
     * @return
     */
    @RequestMapping("/queryList")
    @ResponseBody
    public ToJson<PzDailyPeace> queryList(Integer output, PzDailyPeace pzDailyPeace, Integer page, Integer pageSize, boolean useFlag,
                                          HttpServletRequest request, HttpServletResponse response){
        return pzDailyPeaceService.queryList(output,pzDailyPeace, page, pageSize, useFlag,request,response);
    }

    /**
     * @description: : 根据id查询每日平安稳定信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param dailyId
     * @return
     */
    @RequestMapping("/selectById")
    @ResponseBody
    public ToJson<PzDailyPeace> selectById(Integer dailyId){
        return pzDailyPeaceService.selectById(dailyId);
    }

    /**
     * @description: : 根据时间查询每日平安稳定信息
     * @createBy:  刘新婷
     * @createTime:  2017-12-07
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/selectByCreateDate")
    @ResponseBody
    public ToJson<PzDailyPeace> selectByCreateDate(String startDate, String endDate){
        return pzDailyPeaceService.selectByCreateDate(startDate,endDate);
    }
}
